package com.yanqu.road.server.cmd.relatives;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.relatives.RelativesProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C_RELATIVES_CANCEL_BACK, desc = "解除亲家(返回)")
public class CrossRelativesCancelBackCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        RelativesProto.CrossCancelRelativesRespMsg reqMsg = RelativesProto.CrossCancelRelativesRespMsg.parseFrom(packet.getBytes());
        MessageHelper.sendPacket(reqMsg.getReq().getToServerId(), reqMsg.getReq().getRelativesId(), YanQuMessageUtils.buildMessage(Protocol.S_RELATIVES_CANCEL_BACK_FROM_CROSS, reqMsg.toBuilder()));
    }

    @Override
    public void sendData() {

    }
}
